import torch

def test_instance():
    from model import DigitClassifier
    # 创建模型实例
    model = DigitClassifier()
    # 测试输入 模拟一个MNIST图像
    dummy_input = torch.randn(1, 1, 28, 28) 
    output = model(dummy_input)
    # 应输出 [1, 10]
    print(f"输出形状: {output.shape}")          
    print(f"预测类别得分: {output}")
    return True

def test_all():
    assert test_instance() == True , "初始化成功"